/**
 * Notes: 项目反馈实体
 * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
 * Date: 2024-03-15 19:20:00 
 */

const BaseProjectModel = require('../config/models_config').base_project_model;

class ProjectFeedbackModel extends BaseProjectModel {

}

// 集合名
ProjectFeedbackModel.CL = BaseProjectModel.C('oa_project_feedback');

ProjectFeedbackModel.DB_STRUCTURE = {
    _pid: 'string|true',
    FEEDBACK_ID: 'string|true',
    
    FEEDBACK_PROJECT_ID: 'string|true|comment=项目ID',
    FEEDBACK_PRODUCT_ID: 'string|false|comment=产品ID',
    FEEDBACK_CUSTOMER_ID: 'string|true|comment=客户ID',
    FEEDBACK_CUSTOMER_NAME: 'string|false|comment=客户名称',
    
    FEEDBACK_TITLE: 'string|true|comment=反馈标题',
    FEEDBACK_CONTENT: 'string|true|comment=反馈内容',
    FEEDBACK_TYPE: 'int|true|default=1|comment=反馈类型：1=功能问题, 2=性能问题, 3=质量问题, 4=建议, 5=其他',
    FEEDBACK_PRIORITY: 'int|true|default=2|comment=优先级：1=低, 2=中, 3=高, 4=紧急',
    FEEDBACK_STATUS: 'int|true|default=1|comment=状态：1=待处理, 2=处理中, 3=已解决, 4=已拒绝, 5=已关闭',
    
    FEEDBACK_IMAGES: 'array|true|default=[]|comment=反馈图片',
    FEEDBACK_FILES: 'array|true|default=[]|comment=反馈附件',
    
    FEEDBACK_HANDLER_ID: 'string|false|comment=处理人ID',
    FEEDBACK_HANDLER_NAME: 'string|false|comment=处理人姓名',
    FEEDBACK_SOLUTION: 'string|false|comment=解决方案',
    FEEDBACK_SOLUTION_DATE: 'int|false|comment=解决日期',
    
    FEEDBACK_VERIFICATION_RESULT: 'int|false|comment=验证结果：1=通过, 2=不通过',
    FEEDBACK_VERIFICATION_NOTES: 'string|false|comment=验证备注',
    FEEDBACK_VERIFICATION_DATE: 'int|false|comment=验证日期',
    
    FEEDBACK_BUSINESS_USER_ID: 'string|false|comment=业务对接人ID',
    FEEDBACK_TECHNICAL_USER_ID: 'string|false|comment=技术对接人ID',
    
    FEEDBACK_COMMENTS: 'array|true|default=[]|comment=评论数组',
    /*
    {
        userId: 'string', // 用户ID
        userName: 'string', // 用户名
        content: 'string', // 评论内容
        time: 'number', // 评论时间
        type: 'number' // 评论类型：1=普通评论, 2=状态变更, 3=内部备注
    }
    */
    
    FEEDBACK_RELATED_TASKS: 'array|true|default=[]|comment=关联任务ID数组',
    FEEDBACK_TAGS: 'array|true|default=[]|comment=标签数组',
    
    FEEDBACK_ADD_USER_ID: 'string|false|comment=创建人ID',
    FEEDBACK_ADD_USER_NAME: 'string|false|comment=创建人姓名',
    FEEDBACK_ADD_TIME: 'int|true',
    FEEDBACK_EDIT_TIME: 'int|true',
    FEEDBACK_ADD_IP: 'string|false',
    FEEDBACK_EDIT_IP: 'string|false',
};

// 字段前缀
ProjectFeedbackModel.FIELD_PREFIX = "FEEDBACK_";

/**
 * 反馈类型：1=功能问题, 2=性能问题, 3=质量问题, 4=建议, 5=其他
 */
ProjectFeedbackModel.TYPE = {
    FUNCTION: 1,
    PERFORMANCE: 2,
    QUALITY: 3,
    SUGGESTION: 4,
    OTHER: 5
};

ProjectFeedbackModel.TYPE_DESC = {
    FUNCTION: '功能问题',
    PERFORMANCE: '性能问题',
    QUALITY: '质量问题',
    SUGGESTION: '建议',
    OTHER: '其他'
};

/**
 * 优先级：1=低, 2=中, 3=高, 4=紧急
 */
ProjectFeedbackModel.PRIORITY = {
    LOW: 1,
    MEDIUM: 2,
    HIGH: 3,
    URGENT: 4
};

ProjectFeedbackModel.PRIORITY_DESC = {
    LOW: '低',
    MEDIUM: '中',
    HIGH: '高',
    URGENT: '紧急'
};

/**
 * 状态：1=待处理, 2=处理中, 3=已解决, 4=已拒绝, 5=已关闭
 */
ProjectFeedbackModel.STATUS = {
    PENDING: 1,
    PROCESSING: 2,
    RESOLVED: 3,
    REJECTED: 4,
    CLOSED: 5
};

ProjectFeedbackModel.STATUS_DESC = {
    PENDING: '待处理',
    PROCESSING: '处理中',
    RESOLVED: '已解决',
    REJECTED: '已拒绝',
    CLOSED: '已关闭'
};

/**
 * 验证结果：1=通过, 2=不通过
 */
ProjectFeedbackModel.VERIFICATION_RESULT = {
    PASS: 1,
    FAIL: 2
};

ProjectFeedbackModel.VERIFICATION_RESULT_DESC = {
    PASS: '通过',
    FAIL: '不通过'
};

module.exports = ProjectFeedbackModel; 